<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <input type="text" name="" id="">
</body>
<script>
  // 判断大小
  var num1 = 10;
  var num2 = 50;
  if (num1 > num2) {
    console.log(num1)
  } else {
    console.log(num2)
  }
  num1 > num2 ? console.log(num1) : console.log(num2)
  // 判断整数
  var num3 = 0;
  var num4 = 5;
  var num5 = -5;
  if (num4 % 1 == 0) {
    if (num4 > 0) {
      console.log("这是一个正整数")
    } else if (num4 < 0) {
      console.log("这是一个负整数")
    } else {
      console.log("这是0")
    }
  } else {
    consol.log("这不是一个整数")
  }
  // 判断一个整数是偶数还是奇数
  if (num4 % 1 == 0) {
    if (num4 % 2 == 0) {
      console.log("这是一个偶数")
    } else if (num4 % 2 != 0) {
      console.log("这是一个奇数")
    } else {
      console.log("这是0")
    }
  } else {
    consol.log("这不是一个整数")
  }
  // 查看体重是否标准
  var weight = 78
  var tall = 177
  var bz = weight / ((tall - 108) * 2)
  if (weight >= bz + 10) {
    console.log("偏胖哟")
  } else if (weight > bz + 20) {
    console.log("很胖哟")
  } else if (weight < bz - 10) {
    console.log("偏瘦哟")
  } else if (weight < bz - 20) {
    console.log("很瘦哟")
  } else {
    console.log("爆掉了")
  }

  // 小王的月薪和10年后收入
  var money = 10;
  var zhang = 0.05;
  var total = 12 * 10;
  var total1 = 0
  for (var year = 1; year <= 9; year++) {
    money = money * zhang + money
    if (year == 9) {
      var moneymax = money
      console.log("10年后月薪：" + moneymax)
    }
    for (var month = 1; month <= 12; month++) {
      total1 = money + total1
    }
  }
  total1 += total
  console.log("10年后总工资" + total1)
  // 打印1-100中7的倍数 或者带 7的数字
  document.write("和7有关的有：")
  for (var num = 1; num <= 100; num++) {
    if (num % 7 == 0) {
      document.write(+num + ",")
    } else if (num % 10 == 7) {
      document.write(num + ",")
    }
  }
  // 打印100以内的奇数
  var number11 = 1
  document.write("100中奇数有：")
  while (number11 <= 100) {
    if (number11 % 2 != 0) {
      document.write(+number11 + ",")
    }
    number11++
  }
  // 判断成绩
  window.onload = function () {
    var n = prompt("请输入你的成绩", "")
    switch (true) {
      case n >= 90:
        console.log("你的成绩是：A")
        break;
      case n >= 80 && n < 90:
        console.log("你的成绩是：B")
        break;
      case n >= 70 && n < 80:
        console.log("你的成绩是：C")
        break;
      case n >= 60 && n < 70:
        console.log("你的成绩是：D")
        break;
      default:
        console.log("你的成绩是：E")
        break;
    }
  }
  // 显示当月的天数
  window.onload = function () {
    var y = prompt("请问你想查询几月", "")
    switch (true) {
      case y == 1 || y == 3 || y == 5 || y == 7 || y == 8 || y == 10 || y == 12:
        console.log("一共31天哟，亲")
        break;
      case y == 4 || y == 6 || y == 9 || y == 11:
        console.log("一共30天哟，亲")
        break;

      default:
        console.log("一共28天哟，亲")
        break;
    }
  }
</script>

</html>